//
//  MainNewsCell.swift
//  lookLikeIweekly
//
//  Created by Mainzxq on 16/6/12.
//  Copyright © 2016年 Mainzxq. All rights reserved.
//

import UIKit

let WIDTH = UIScreen.mainScreen().bounds.width
let HEIGHT = UIScreen.mainScreen().bounds.height

class MainNewsCell: UICollectionViewCell {
    var imageView = UIImageView()
    var titleLbl = UILabel()
    var contentLbl = UILabel()
    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.frame.size = CGSizeMake(WIDTH, 200)
        self.contentView.frame.size = CGSizeMake(WIDTH, 200)
        self.imageView.frame = CGRectMake(15, 10, WIDTH-30, 200-40)
        self.titleLbl.frame = CGRectMake(15, 172, WIDTH-30, 16)
        self.contentLbl.frame = CGRectMake(15, 190, WIDTH-30, 10)
    }
    
    required init?(coder aDecoder: NSCoder) {
            super.init(coder: aDecoder)
    }
    
    override func layoutSubviews() {
        self.imageView.contentMode = .ScaleAspectFill
        self.imageView.clipsToBounds = true
        self.contentLbl.textColor = UIColor.grayColor()
        self.titleLbl.textColor = UIColor.blackColor()
        self.contentLbl.lineBreakMode = NSLineBreakMode.ByWordWrapping
        self.contentLbl.numberOfLines = 2
        self.contentLbl.font = UIFont(name: "HelveticaNeue-Light", size: CGFloat(10))
        self.titleLbl.font = UIFont(name: "HelveticaNeue", size: CGFloat(14))
        self.contentView.addSubview(imageView)
        self.contentView.addSubview(contentLbl)
        self.contentView.addSubview(titleLbl)
    }
    
}
